import { useState, useEffect } from 'react';
import request from 'umi-request';

export const useWt = () => {
  const [wtTemp, setWtTemp] = useState<string>('');
  const [wtNm, setWtNm] = useState<string>('');

  // useEffect(() => {
  //   request
  //     .get(
  //       'http://api.k780.com/?app=weather.realtime&weaId=94&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json',
  //     )
  //     .then((response) => {
  //       setWtTemp(response.result?.realTime?.wtTemp);
  //       setWtNm(response.result?.realTime?.wtNm);
  //     });
  // }, []);

  return [wtTemp, wtNm];
};
